#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import time

import psutil

from web.config.myquant_config import MyQuantConfig


class ProjectManager:

    def start_myquant_if_not_exist(self):
        """
        如果掘金量化软件没有启动，则启动
        """

        for process in psutil.process_iter(['name']):
            if process.info['name'] == 'goldminer3.exe':
                return
        result = os.system(MyQuantConfig.MyQuant_Startup_Exe_File)
        time.sleep(30)
